"""
33 - Dars
"""
F = open('file.txt', 'r', encoding='utf-8')
TEXT = F.read(2)
TEXT2 = F.read(8)
print(F.encoding)
TEXT = F.read()
F.close()
print(TEXT)
print(TEXT2)

F = open('file.txt', 'a', encoding='utf-8')
F.write('Bakalashka\n')
F.close()

LINES = ['Shaftoli 1', 'Olma 2']
F = open('file.txt', 'a', encoding='utf-8')
for i in LINES:
    F.write(i + '\n')
F.writelines(LINES)
F.writelines(f'{i}\n' for i in LINES)
F.close()

F = open('file.txt', 'r', encoding='utf-8')
for line in F:
    print(line, end='')
F.close()

LINES = ['Og\'abek Abdumuradov', '11 yosh.']
FFF = open('file.txt', 'w', encoding='utf-8')
# FFF.writelines(f'{i} ' for i in lines)
FFF.close()
